
/* Generated by Interface Builder */

#import "SimpleField.h"
#import "ObserveDispatch.h"

@implementation SimpleField

- initFrame:(const NXRect *)rectFrame
{
    [super initFrame:rectFrame];

    // Create the default observer object
    observer = [[ObserveDispatch alloc] init];
    	
    return self;
}

/*
	Method: takeIntValueFrom:
		This routine is called by the scroller as it increases and decreases
		its value.  It sets the int value of the current cell and dispatches
		to the other cells as well.
*/
	
- takeIntValueFrom:sender
{
	[super takeIntValueFrom:sender];
	[observer takeIntValueFrom:sender];

	return self;
}

/*
	Method: forward::
		Tries to forward messages that this object doesn't understand.  It is
		put here so that messages can be re-routed to the observer by default.
		This way you don't have to implement a specific instance variable
		return method for the observer and it looks like you are adding
		observers directly to this class instead.
*/

- forward:(SEL)aSelector :(marg_list)argFrame
{
    char *selectorName = sel_getName(aSelector);
	
    if ([observer respondsTo:aSelector])
	    [observer performv:aSelector :argFrame];
	else
	    printf("SimpleField does not understand: %s\n",selectorName);

	return self;
}

@end
